package com.fancy.controller;

import com.fancy.pojo.BaseResult;
import com.fancy.service.SearchMusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
public class SearchController {
    @Autowired
    SearchMusicService searchMusicService;

    @RequestMapping("/search/{index}")
    public BaseResult search(@PathVariable("index") String index) throws IOException {
        return searchMusicService.search(index);
    }

}
